package org.whuims.pois.model;

import org.apache.struts.action.ActionForm;
import org.whuims.poms.bean.EntityEntity;
import org.whuims.poms.bean.VectorEntity;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Transient;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by zhongwei on 2014/5/13.
 */
@Entity
@javax.persistence.Table(name = "data_c")
public class DataC extends ActionForm{
    private static final long serialVersionUID = -994248628514614431L;
    private long id;
    private String titlecontent;
    private String titlelink;
    private String abstext;
    private Timestamp newstime;
    private String charset;
    private String type;
    private String sitename;
    private String filepath;
    private Integer importance;
    private Integer negativeindex;
    private String category;
    private VectorEntity vector;
    private EntityEntity entity;
    private Timestamp crawltime;
    private String pcontent;
    private String planguage;
    private String prelatedwords;
    private String pkeyword;
    private Long crawlerid;
    private long topicid;
    private int status;
    private Byte isreply;
    private Integer clicknum;
    private Integer replynum;


    @Id
    @javax.persistence.Column(name = "id")
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    @Basic
    @javax.persistence.Column(name = "titlecontent")
    public String getTitlecontent() {
        return titlecontent;
    }

    public void setTitlecontent(String titlecontent) {
        this.titlecontent = titlecontent;
    }

    @Basic
    @javax.persistence.Column(name = "titlelink")
    public String getTitlelink() {
        return titlelink;
    }

    public void setTitlelink(String titlelink) {
        this.titlelink = titlelink;
    }

    @Basic
    @javax.persistence.Column(name = "abstext")
    public String getAbstext() {
        return abstext;
    }

    public void setAbstext(String abstext) {
        this.abstext = abstext;
    }

    @Basic
    @javax.persistence.Column(name = "newstime")
    public Timestamp getNewstime() {
        return newstime;
    }

    public void setNewstime(Timestamp newstime) {
        this.newstime = newstime;
    }

    @Basic
    @javax.persistence.Column(name = "charset")
    public String getCharset() {
        return charset;
    }

    public void setCharset(String charset) {
        this.charset = charset;
    }

    @Basic
    @javax.persistence.Column(name = "type")
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Basic
    @javax.persistence.Column(name = "sitename")
    public String getSitename() {
        return sitename;
    }

    public void setSitename(String sitename) {
        this.sitename = sitename;
    }

    @Basic
    @javax.persistence.Column(name = "filepath")
    public String getFilepath() {
        return filepath;
    }

    public void setFilepath(String filepath) {
        this.filepath = filepath;
    }

    @Basic
    @javax.persistence.Column(name = "importance")
    public Integer getImportance() {
        return importance;
    }

    public void setImportance(Integer importance) {
        this.importance = importance;
    }

    @Basic
    @javax.persistence.Column(name = "negativeindex")
    public Integer getNegativeindex() {
        return negativeindex;
    }

    public void setNegativeindex(Integer negativeindex) {
        this.negativeindex = negativeindex;
    }

    @Basic
    @javax.persistence.Column(name = "category")
    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    @Basic
    @javax.persistence.Column(name = "vector")
    public VectorEntity getVector() {
        return vector;
    }

    public void setVector(VectorEntity vector) {
        this.vector = vector;
    }

    @Basic
    @javax.persistence.Column(name = "entity")
    public EntityEntity getEntity() {
        return entity;
    }

    public void setEntity(EntityEntity entity) {
        this.entity = entity;
    }

    @Basic
    @javax.persistence.Column(name = "crawltime")
    public Timestamp getCrawltime() {
        return crawltime;
    }

    public void setCrawltime(Timestamp crawltime) {
        this.crawltime = crawltime;
    }

    @Basic
    @javax.persistence.Column(name = "pcontent")
    public String getPcontent() {
        return pcontent;
    }

    public void setPcontent(String pcontent) {
        this.pcontent = pcontent;
    }

    @Basic
    @javax.persistence.Column(name = "planguage")
    public String getPlanguage() {
        return planguage;
    }

    public void setPlanguage(String planguage) {
        this.planguage = planguage;
    }

    @Basic
    @javax.persistence.Column(name = "prelatedwords")
    public String getPrelatedwords() {
        return prelatedwords;
    }

    public void setPrelatedwords(String prelatedwords) {
        this.prelatedwords = prelatedwords;
    }

    @Basic
    @javax.persistence.Column(name = "pkeyword")
    public String getPkeyword() {
        return pkeyword;
    }

    public void setPkeyword(String pkeyword) {
        this.pkeyword = pkeyword;
    }

    @Basic
    @javax.persistence.Column(name = "crawlerid")
    public Long getCrawlerid() {
        return crawlerid;
    }

    public void setCrawlerid(Long crawlerid) {
        this.crawlerid = crawlerid;
    }

    @Basic
    @javax.persistence.Column(name = "topicid")
    public long getTopicid() {
        return topicid;
    }

    public void setTopicid(long topicid) {
        this.topicid = topicid;
    }

    @Basic
    @javax.persistence.Column(name = "status")
    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    @Basic
    @javax.persistence.Column(name = "isreply")
    public Byte getIsreply() {
        return isreply;
    }

    public void setIsreply(Byte isreply) {
        this.isreply = isreply;
    }

    @Basic
    @javax.persistence.Column(name = "clicknum")
    public Integer getClicknum() {
        return clicknum;
    }

    public void setClicknum(Integer clicknum) {
        this.clicknum = clicknum;
    }

    @Basic
    @javax.persistence.Column(name = "replynum")
    public Integer getReplynum() {
        return replynum;
    }

    public void setReplynum(Integer replynum) {
        this.replynum = replynum;
    }

    private List<DataC> similarList = new ArrayList<DataC>();

    @Transient
    public List<DataC> getSimilarList() {
        return similarList;
    }

    public void addSimilar(DataC data) {
        if (similarList == null) {
            similarList = new ArrayList<DataC>();
        }
        similarList.add(data);
    }

    public DataC() {
    }

    public DataC(String titlecontent, String titlelink, String abstext, Timestamp newstime, String charset, String type, String sitename, String filepath, Integer importance, Integer negativeindex, String category, VectorEntity vector, EntityEntity entity, Timestamp crawltime, String pcontent, String planguage, String prelatedwords, String pkeyword, Long crawlerid, long topicid, int status, Byte isreply, Integer clicknum, Integer replynum) {
        this.titlecontent = titlecontent;
        this.titlelink = titlelink;
        this.abstext = abstext;
        this.newstime = newstime;
        this.charset = charset;
        this.type = type;
        this.sitename = sitename;
        this.filepath = filepath;
        this.importance = importance;
        this.negativeindex = negativeindex;
        this.category = category;
        this.vector = vector;
        this.entity = entity;
        this.crawltime = crawltime;
        this.pcontent = pcontent;
        this.planguage = planguage;
        this.prelatedwords = prelatedwords;
        this.pkeyword = pkeyword;
        this.crawlerid = crawlerid;
        this.topicid = topicid;
        this.status = status;
        this.isreply = isreply;
        this.clicknum = clicknum;
        this.replynum = replynum;
    }
}
